package com.oocl.jsonparse;

import java.util.List;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import POJO.Books;


public class JSONParse {
	
	private ObjectMapper mapper = new ObjectMapper();

	public JSONParse(){
	}
	
	public String[] parse(List<Books> books) throws JsonProcessingException{
		int size = books.size();
		String[] result = new String[size];
		for (int i = 0; i < books.size(); i++) {
			result[i] = mapper.writeValueAsString(books.get(i));
		}
		return result;
	}

}
